<%@taglib prefix="s" uri="/struts-tags" %>
<%@page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>

<html>
<head>
    <title>${type.name} - <s:text name="item.info"/></title>
</head>

<body class="displayItemInfo">

	<!-- Main part -->
	<div id="itemInfo" class="bordered">
		<div>
			<table class="iconTable">
				<tr>
					<td class="img64Cell" style="background-image: url(img/Types/${type.id}_64.png)"></td>
				</tr>
			</table>
			#${type.id} <span class="current">${type.name}</span>
			<p>${type.description}</p>
		</div>		
		<br/>
		<table id="itemInfoTable" class="completelyBordered">
			<tr>
				<td class="labelCell"><s:text name="group"/></td>
				<td>		
			<a href="Groups?categoryId=${type.group.category.id}">${type.group.category.name}</a> > 
			<span class="current"><a href="Search?groupId=${type.group.id}">${type.group.name}</a></span>
				</td>
			</tr>
	
			<s:if test="type.marketGroup">
				<tr>
					<td class="labelCell"><s:text name="market.group"/></td>
					<td>
						<s:set var="parents" value="marketGroupParents"/>
						<s:iterator value="parents" var="current" end="0" begin="#parents.size - 1" step="-1">
							<a href="SearchMarketGroups?id=${current.id}">${current.name}</a> >  
						</s:iterator>
						<span class="current"><a href="Search?marketGroupId=${type.marketGroup.id}">${type.marketGroup.name}</a></span>
					</td>
				</tr>
			</s:if>
			
			<tr>
				<td class="labelCell"><s:text name="radius"/></td>
				<td><s:text name="format.number"><s:param value="type.radius"/></s:text></td>
			</tr>
			
			<tr>
				<td class="labelCell"><s:text name="mass"/></td>
				<td>${type.mass}</td>
			</tr>
			
			<tr>
				<td class="labelCell"><s:text name="volume"/></td>
				<td><s:text name="format.number"><s:param value="type.volume"/></s:text></td>
			</tr>
			<s:if test="type.capacity"><tr><td class="labelCell"><s:text name="capacity"/></td><td>${type.capacity}</td></tr></s:if>
			<tr><td class="labelCell"><s:text name="portion.size"/></td><td>${type.portionSize}</td></tr>
			<s:if test="type.race"><tr><td class="labelCell"><s:text name="race"/></td><td><a href="RaceInfo?id=${type.race.id}">${type.race.name}</a></td></tr></s:if>
			
			<tr>
				<td class="labelCell"><s:text name="base.price"/></td>
				<td><s:text name="format.money"><s:param value="type.basePrice"/></s:text></td>
			</tr>
			
			<tr>
				<td class="labelCell"><s:text name="chance.of.duplicating"/></td>
				<td><s:text name="format.percent"><s:param value="type.chanceOfDuplicating * 100"/></s:text></td>
			</tr>
		</table>
	</div>
	
</body>

</html>